<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>for you</title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/particlesjs/2.2.2/particles.min.js"></script>

    <style>
        html, body {
            margin: 0;
            padding: 0;
        }
        .background {
            position:  absolute;
            display:  block;
            top: 0;
            left: 0;
            z-index: 0;
            background: black;
        }
        #all{
            position: relative;
            width: 100vw;
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            flex-direction: column;

        }
        #Rbox{
            position: relative;
            width: 200px;
            height: 200px;
            /* background-color: white; */
            z-index: 2000;
        }

        #minbox{
            width: 100px;
            height: 100px;
            padding: 0;
            position: absolute;
            top: 50px;
            left: 50px;
            -webkit-transform-style: preserve-3D;  
            animation: spin 5s linear infinite;              
        }
        #minbox li{
            position: absolute;
            top: 0px;
            left: 0px;
            list-style: none;
            width: 100px;
            height: 100px;
            background-color: rgb(17, 249, 222); 
  

            /* -webkit-box-reflect: below 16px -webkit-linear-gradient(transparent,transparent 50%,rgba(255,255,255,0.6)); */
            
        }
        #minbox li:nth-child(1){
            background: url(./src/img/envelope/1.png) no-repeat;
            -webkit-transform: translateZ(50px);
        }
        #minbox li:nth-child(2){
            background: url(./src/img/envelope/2.png) no-repeat;
            -webkit-transform: rotateX(180deg) translateZ(50px);
        }
        #minbox li:nth-child(3){
            background: url(./src/img/envelope/3.png) no-repeat;
            -webkit-transform: rotateX(90deg) translateZ(50px);
        }
        #minbox li:nth-child(4){
            background: url(./src/img/envelope/4.png) no-repeat;
            -webkit-transform: rotateX(-90deg) translateZ(50px);
        }
        #minbox li:nth-child(5){
            background: url(./src/img/envelope/5.png) no-repeat;
            -webkit-transform: rotateY(90deg) translateZ(50px);
        }
        #minbox li:nth-child(6){
            background: url(./src/img/envelope/6.png) no-repeat;
            -webkit-transform: rotateY(-90deg) translateZ(50px);
        }


        #maxbox{
            width: 150px;
            height: 150px;
            position: absolute;
            top: 25px;
            left: 25px;
            padding: 0;
            -webkit-transform-style: preserve-3D;  
            animation: spin 5s linear infinite;    
        }
        #maxbox li{
            position: absolute;
            top: 0;
            left: 0;
            border: 5px solid rgb(224, 144, 24);
            list-style: none;
            width: 150px;
            height: 150px;
            opacity: 0.2;
            background-color: rgb(224, 144, 24); 
            -webkit-transition: all 1s ease; 
        }
        #maxbox li:nth-child(1){
            background: url(./src/img/envelope/01.png) no-repeat;
            -webkit-transform: translateZ(75px);
        }
        #maxbox li:nth-child(2){
            background: url(./src/img/envelope/02.png) no-repeat;
            -webkit-transform: rotateX(180deg) translateZ(75px);
        }
        #maxbox li:nth-child(3){
            background: url(./src/img/envelope/03.png) no-repeat;
            -webkit-transform: rotateX(90deg) translateZ(75px);
        }
        #maxbox li:nth-child(4){
            background: url(./src/img/envelope/04.png) no-repeat;
            -webkit-transform: rotateX(-90deg) translateZ(75px);
        }
        #maxbox li:nth-child(5){
            background: url(./src/img/envelope/05.png) no-repeat;
            -webkit-transform: rotateY(90deg) translateZ(75px);
        }
        #maxbox li:nth-child(6){
            background: url(./src/img/envelope/06.png) no-repeat;
            -webkit-transform: rotateY(-90deg) translateZ(75px);
        }

        #Rbox:hover #maxbox li{
            -webkit-box-shadow:0px 0px 22px 9px rgb(238, 136, 20);
            -moz-box-shadow: 0px 0px 22px 9px rgb(246, 116, 10);
            box-shadow: 0px 0px 22px 9px rgb(246, 116, 10);
        }
        #Rbox:hover #maxbox li:nth-child(1){
            -webkit-transform:  translateZ(130px);
            width: 200px;
            height: 200px;
            left: -25px;
            top: -25px;
            opacity: 0.8;
        }
        #Rbox:hover #maxbox li:nth-child(2){
            -webkit-transform: rotateX(180deg) translateZ(130px);
            width: 200px;
            height: 200px;
            left: -25px;
            top: -25px;
            opacity: 0.8;
        }
        #Rbox:hover #maxbox li:nth-child(3){
            -webkit-transform: rotateX(90deg) translateZ(130px);
            width: 200px;
            height: 200px;
            left: -25px;
            top: -25px;
            opacity: 0.8;
        }
        #Rbox:hover #maxbox li:nth-child(4){
            -webkit-transform: rotateX(-90deg) translateZ(130px);
            width: 200px;
            height: 200px;
            left: -25px;
            top: -25px;
            opacity: 0.8;
        }
        #Rbox:hover #maxbox li:nth-child(5){
            -webkit-transform: rotateY(90deg) translateZ(130px);
            width: 200px;
            height: 200px;
            left: -25px;
            top: -25px;
            opacity: 0.8;
        }
        #Rbox:hover #maxbox li:nth-child(6){
            -webkit-transform: rotateY(-90deg) translateZ(130px);
            width: 200px;
            height: 200px;
            left: -25px;
            top: -25px;
            opacity: 0.8;
        }

        @keyframes spin {
            0%{
                -webkit-transform: rotateX(360deg) rotateY(0);
            }
            33%{
                -webkit-transform: rotateX(240deg) rotateY(120deg);
            }
            67%{
                -webkit-transform: rotateX(120deg) rotateY(240deg);
            }
            100%{
                -webkit-transform: rotateX(0) rotateY(360deg);
            }
        }
        #paragraph{
            z-index: 100;
            color: white;
            font-size: 30px;
            margin: 90px 0 0 30px;
        }
        .p2{
            z-index: 100;
            color: white;
            font-size: 20px;
            margin: 20px;
        }
        #audio{
            z-index: 100;
        }
    </style>
</head>
<body>
    <canvas class="background"></canvas>

    <div id="all">

        <div id='Rbox'>
            <ul id="minbox"></ul>
            <ul id="maxbox"></ul>
        </div>
        <div id="paragraph">

            Together, in the name of love, will you?
        </div>
        <div class="p2">
            要在一起吗？
        </div>

        <div id="audio">
            <audio controls src="./src/audio/故事还温热.mp3"></audio>
        </div>

    </div>


    <script>
        window.onload = function() {
            Particles.init({
            // normal options
            selector: '.background',
            maxParticles: 150,
            // options for breakpoints
            speed:0.2,
            color:['#0000ff','#ff0000','#00ff00'],
            connectParticles:true,
            responsive: [
                {
                breakpoint: 100,
                options: {
                    maxParticles: 200,
                    color: '#0000ff',
                    connectParticles: false
                }
                }, {
                breakpoint: 110,
                options: {
                    maxParticles: 100,
                    connectParticles: true
                }
                }, {
                breakpoint: 120,
                options: {
                    maxParticles: 0 // disables particles.js
                }
                }
            ]
            });
        }; 

        let minbox = document.getElementById('minbox')
            for(let i = 1;i<=6;i++){
                let li = document.createElement('li')
                minbox.appendChild(li)
            }
        let maxbox = document.getElementById('maxbox')
            for(let i = 1;i<=6;i++){
                let li = document.createElement('li')
                maxbox.appendChild(li)
            }
    </script>

</body>
</html>

<style>
</style>